
#include <linux/module.h>
#include <linux/init.h>
#include <linux/vfs.h>
#include <linux/fs.h>

//挂载函数
int sfs_fill_super(struct super_block *s, void *data, int silent)
{
    return 0;
}

struct dentry *sfs_mount(struct file_system_type *fs_type, int flags,
    const char *dev_name, void *data)
{
    return mount_bdev(fs_type, flags, dev_name, data, sfs_fill_super);
}

//设置文件系统描述结构
static struct file_system_type sfs_type = {
    .owner  =   THIS_MODULE,
    .name   =   "sfs",
    .mount  =   sfs_mount,
    .fs_flags   =   FS_REQUIRES_DEV
};


static int __init init_sfs(void)
{
    return 0;
}

static void __exit exit_sfs(void)
{

}

module_init(init_sfs)
module_exit(exit_sfs)

MODULE_LICENSE("GPL");